package sctu.edu.java.year2016.team01.xuhanmei.day20160520.chapter3_10_2;

/**
 * Created by Administrator on 2016/5/20.
 *  创建两个int型变量，运用三元运算符判断两个变量是否相等，若不想等求出两个数中较大者
 */
import java.util.Scanner;
public class sanyuanyunsuan {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入a：");
        int a = scan.nextInt();
        System.out.println("请输入b:");
        Scanner sca = new Scanner(System.in);
        int b = sca.nextInt();
        int c;
        if (a == b) {
            System.out.println("a等于b");
        } else {
            c = (a > b) ? a : b;
            System.out.println("较大者是：" + c);
        }

    }

}
